package a.f.e;

import a.c.*;
import a.c.e;
import a.c.m;
import a.f.fc;
import a.i.wb;

public class d
  extends b
{
  private e[][] bb;
  private e[] cb;
  private double[] db;
  private g[] eb;
  private x fb;
  private double gb;
  private double hb = 2.5D;
  private int ib = 3;
  private int jb = 20;
  private int kb = 6;
  private int lb = 50;
  private boolean mb = false;
  private boolean nb = true;
  private wb ob;
  private long pb;
  private long qb = 2147483647L;
  private long rb;
  private int sb;
  private static final boolean tb = false;
  private static final boolean ub = false;
  private static final boolean vb = false;
  public static boolean wb;
  
  public boolean t()
  {
    return this.mb;
  }
  
  public void k(boolean paramBoolean)
  {
    this.mb = paramBoolean;
  }
  
  public void a(long paramLong)
  {
    this.qb = paramLong;
  }
  
  public long u()
  {
    return this.qb;
  }
  
  private boolean v()
  {
    long l = System.currentTimeMillis() - this.pb;
    if (a.B == 0) {
      if (l > this.rb) {
        return false;
      }
    }
    return true;
  }
  
  void b(g[] paramArrayOfg)
  {
    super.b(paramArrayOfg);
    this.sb = this.W.k();
  }
  
  bb d(g[] paramArrayOfg)
  {
    int k = a.B;
    int j = a.A;
    if (k == 0) {
      if (this.qb != 2147483647L)
      {
        double d = this.W.k() / this.sb;
        this.rb = ((this.qb * d));
        if (k != 0) {
          break label106;
        }
        if (j == 0) {
          break label70;
        }
      }
    }
    this.rb = 2147483647L;
    label70:
    this.pb = System.currentTimeMillis();
    this.eb = paramArrayOfg;
    w();
    this.cb = new e[paramArrayOfg.length];
    this.fb = this.W.B();
    label106:
    this.ob = (t() ? new wb(11L) : new wb());
    if (k == 0) {}
    boolean bool = this.nb ? a(this.cb) : b(this.cb);
    if (k == 0)
    {
      if (bool) {
        return new bb();
      }
      this.gb = 0.0D;
      this.db = new double[paramArrayOfg.length];
      this.gb = x();
      c(this.cb);
    }
    bb localbb = new bb();
    int i = 0;
    do
    {
      if (i >= this.cb.length) {
        break;
      }
      if (j != 0) {
        break label277;
      }
      if (this.cb[i] != null) {
        localbb.add(this.cb[i]);
      }
      i++;
    } while (j == 0);
    if (k == 0) {
      label277:
      this.W.a(this.fb);
    }
    return localbb;
  }
  
  private void w()
  {
    int m = a.B;
    int k = a.A;
    this.bb = new e[this.eb.length][];
    int i = 0;
    label149:
    label151:
    do
    {
      if (i >= this.eb.length) {
        break;
      }
      g localg = this.eb[i];
      z localz = localg.b();
      this.bb[i] = new e[localz.size()];
      int j = 0;
      y localy = localz.h();
      do
      {
        if (!localy.e()) {
          break;
        }
        fc localfc = (fc)localy.j();
        e locale = (e)this.Y.get(localfc);
        this.bb[i][(j++)] = locale;
        localy.f();
        if (m != 0) {
          break label151;
        }
        if (k != 0) {
          break label149;
        }
      } while (k == 0);
      if (m == 0) {
        i++;
      }
    } while (k == 0);
  }
  
  private boolean a(e[] paramArrayOfe)
  {
    int m = a.B;
    int k = a.A;
    boolean bool = true;
    int i = 0;
    if (i < this.eb.length)
    {
      if (k != 0) {
        break label98;
      }
      if (this.bb[i].length != 0) {
        bool = false;
      }
    }
    while (m != 0)
    {
      int j = this.ob.nextInt(this.bb[i].length);
      paramArrayOfe[i] = this.bb[i][j];
      this.fb.a(paramArrayOfe[i], true);
      i++;
      if (k == 0) {
        break;
      }
    }
    label98:
    return bool;
  }
  
  private boolean b(e[] paramArrayOfe)
  {
    int m = a.B;
    int k = a.A;
    c localc = new c();
    localc.b(false);
    localc.a(p());
    localc.g(i());
    localc.f(h());
    localc.a(b());
    localc.e(g());
    localc.d(f());
    localc.a(j());
    localc.e(this.V, this.eb);
    boolean bool = true;
    int i = 0;
    do
    {
      if (i >= this.eb.length) {
        break;
      }
      g localg = this.eb[i];
      if (k != 0) {
        break label212;
      }
      if (this.bb[i].length != 0)
      {
        bool = false;
        e locale = a(localg);
        if (m == 0)
        {
          if (locale == null)
          {
            int j = this.ob.nextInt(this.bb[i].length);
            locale = this.bb[i][j];
          }
          paramArrayOfe[i] = locale;
        }
        this.fb.a(paramArrayOfe[i], true);
      }
      i++;
    } while (k == 0);
    label212:
    return bool;
  }
  
  private e a(g paramg)
  {
    int i = a.B;
    Object localObject = null;
    y localy = paramg.b().h();
    while (localy.e())
    {
      fc localfc = (fc)localy.j();
      if (i == 0)
      {
        if (localfc.r())
        {
          localObject = localfc;
          break;
        }
        localy.f();
      }
    }
    if (i == 0) {
      if (localObject == null) {
        return null;
      }
    }
    return (e)this.Y.get(localObject);
  }
  
  private double a(e parame)
  {
    double d = 0.0D;
    fc localfc = (fc)this.X.get(parame);
    if (a.B == 0) {
      if ((localfc.p() > 0.0D) && (p() == 4)) {
        d = 1.0D;
      }
    }
    d += 1.0D - a(localfc);
    return d;
  }
  
  private double x()
  {
    int k = a.B;
    int j = a.A;
    double d1 = 0.0D;
    int i = 0;
    if (i < this.eb.length) {
      this.db[i] = 0.0D;
    }
    label172:
    label197:
    while (k != 0)
    {
      e locale1 = this.cb[i];
      if ((k != 0) || (locale1 != null))
      {
        m localm = locale1.l();
        do
        {
          if (!localm.e()) {
            break;
          }
          a.c.d locald = localm.a();
          e locale2 = locald.a(locale1);
          if (j != 0) {
            break label197;
          }
          if (this.fb.getBool(locale2))
          {
            if (k == 0) {
              if (p() != 4)
              {
                double d2 = this.H.getDouble(locald) * s();
                this.db[i] += d2;
                d1 += d2;
                if (k != 0) {
                  continue;
                }
                if (j == 0) {
                  break label172;
                }
              }
            }
            this.db[i] += 1.0D;
          }
          localm.f();
        } while (j == 0);
        if (k == 0) {
          if (this.db[i] > 0.0D) {
            if (p() == 4) {
              d1 += 1.0D;
            }
          }
        }
        d1 += a(this.cb[i]);
      }
      i++;
      if (j == 0) {
        break;
      }
    }
    return d1;
  }
  
  private void c(e[] paramArrayOfe)
  {
    int k = a.B;
    int j = a.A;
    double d = this.hb;
    int i = 0;
    boolean bool = true;
    do
    {
      do
      {
        do
        {
          if (!bool) {
            break;
          }
          if (k == 0)
          {
            if (!v())
            {
              if (k != 0) {
                continue;
              }
              if (i >= this.ib) {
                break;
              }
            }
            bool = b(paramArrayOfe, d, this.eb.length);
            d = 0.25D * d;
            i++;
          }
        } while (i <= this.jb);
        bool = false;
      } while (k != 0);
    } while (j == 0);
  }
  
  private boolean a(e[] paramArrayOfe, double paramDouble, int paramInt)
  {
    int i2 = a.B;
    int i1 = a.A;
    int i = 0;
    boolean bool = false;
    if (i < this.lb * paramInt)
    {
      if (i1 != 0) {
        break label871;
      }
      if ((!v()) && ((i2 == 0) && (i >= this.kb))) {}
    }
    label364:
    label498:
    while (i2 != 0)
    {
      int j = this.ob.nextInt(paramInt);
      if (i2 == 0) {
        if (this.bb[j].length <= 1)
        {
          i++;
          if ((i2 == 0) && (i1 == 0)) {
            break;
          }
        }
      }
      int k = this.ob.nextInt(this.bb[j].length);
      e locale1 = paramArrayOfe[j];
      e locale2 = this.bb[j][k];
      paramArrayOfe[j] = locale2;
      this.fb.a(locale1, false);
      this.fb.a(locale2, true);
      double d1 = this.gb;
      double d2 = this.db[j];
      this.gb = (this.gb - a(locale1) + a(locale2));
      m localm1 = locale1.l();
      a.c.d locald1;
      e locale3;
      int m;
      double d5;
      do
      {
        do
        {
          if (!localm1.e()) {
            break;
          }
          locald1 = localm1.a();
          locale3 = locald1.a(locale1);
          if (i1 != 0) {
            break label364;
          }
          if (this.fb.getBool(locale3))
          {
            m = this.Z.getInt(locale3);
            if (i2 != 0) {
              continue;
            }
            if (m != j)
            {
              d5 = this.H.getDouble(locald1) * s();
              this.db[m] -= d5;
              this.db[j] -= d5;
              this.gb -= 2.0D * d5;
            }
          }
          localm1.f();
        } while (i1 == 0);
      } while (i2 != 0);
      localm1 = locale2.l();
      do
      {
        if (!localm1.e()) {
          break label498;
        }
        locald1 = localm1.a();
        locale3 = locald1.a(locale2);
        if (i1 != 0) {
          break;
        }
        if (this.fb.getBool(locale3))
        {
          m = this.Z.getInt(locale3);
          if (i2 != 0) {
            continue;
          }
          if (m != j)
          {
            d5 = this.H.getDouble(locald1) * s();
            this.db[m] += d5;
            this.db[j] += d5;
            this.gb += 2.0D * d5;
          }
        }
        localm1.f();
      } while (i1 == 0);
      double d3 = this.gb - d1;
      do
      {
        if (i2 != 0) {
          break label849;
        }
        if (i2 != 0) {
          break;
        }
        if (d3 > 0.0D)
        {
          double d4 = 1.0D - Math.exp(-d3 / paramDouble);
          if (i2 != 0) {
            break label849;
          }
          if (this.ob.nextDouble() < d4)
          {
            this.gb = d1;
            this.fb.a(locale1, true);
            this.fb.a(locale2, false);
            paramArrayOfe[j] = locale1;
            this.db[j] = d2;
            m localm2 = locale1.l();
            a.c.d locald2;
            e locale4;
            int n;
            do
            {
              do
              {
                if (!localm2.e()) {
                  break;
                }
                locald2 = localm2.a();
                locale4 = locald2.a(locale1);
                if (i1 != 0) {
                  break label735;
                }
                if (this.fb.getBool(locale4))
                {
                  n = this.Z.getInt(locale4);
                  if (i2 != 0) {
                    continue;
                  }
                  if (n != j) {
                    this.db[n] += this.H.getDouble(locald2) * s();
                  }
                }
                localm2.f();
              } while (i1 == 0);
            } while (i2 != 0);
            localm2 = locale2.l();
            do
            {
              if (!localm2.e()) {
                break;
              }
              locald2 = localm2.a();
              locale4 = locald2.a(locale2);
              if (i1 != 0) {
                break label850;
              }
              if (this.fb.getBool(locale4))
              {
                n = this.Z.getInt(locale4);
                if (i2 != 0) {
                  continue;
                }
                if (n != j) {
                  this.db[n] -= this.H.getDouble(locald2) * s();
                }
              }
              localm2.f();
            } while (i1 == 0);
          }
        }
      } while (i2 != 0);
      if (d1 > this.gb) {
        bool = true;
      }
      i++;
      if (i1 == 0) {
        break;
      }
    }
    label735:
    label871:
    return bool;
  }
  
  boolean b(e[] paramArrayOfe, double paramDouble, int paramInt)
  {
    int i3 = a.B;
    int i2 = a.A;
    if (i3 == 0) {
      if (p() != 4) {
        return a(paramArrayOfe, paramDouble, paramInt);
      }
    }
    int i = 0;
    boolean bool = false;
    if (i < this.lb * paramInt)
    {
      if (i2 != 0) {
        break label903;
      }
      if ((!v()) && ((i3 == 0) && (i >= this.kb))) {}
    }
    label360:
    label767:
    while (i3 != 0)
    {
      int j = this.ob.nextInt(paramInt);
      if ((i3 == 0) && (this.bb[j].length == 0)) {
        break;
      }
      int k = this.ob.nextInt(this.bb[j].length);
      if (i3 == 0) {
        if (this.bb[j].length == 1)
        {
          i++;
          if (i2 == 0) {
            break;
          }
        }
      }
      e locale1 = paramArrayOfe[j];
      e locale2 = this.bb[j][k];
      paramArrayOfe[j] = locale2;
      this.fb.a(locale1, false);
      this.fb.a(locale2, true);
      double d1 = this.gb;
      double d2 = this.db[j];
      this.gb = (this.gb - a(locale1) + a(locale2));
      double d3;
      do
      {
        w localw1 = locale1.o();
        do
        {
          if (!localw1.e()) {
            break label360;
          }
          e locale3 = localw1.d();
          if (i2 != 0) {
            break;
          }
          if ((this.fb.getBool(locale3)) && (locale3 != locale1))
          {
            int m = this.Z.getInt(locale3);
            if (i3 != 0) {
              continue;
            }
            if (m != j)
            {
              this.db[m] -= 1.0D;
              if (i3 != 0) {
                continue;
              }
              if (this.db[m] == 0.0D) {
                this.gb -= 1.0D;
              }
            }
          }
          localw1.f();
        } while (i2 == 0);
        d3 = 0.0D;
      } while (i3 != 0);
      w localw2 = locale2.o();
      do
      {
        if (!localw2.e()) {
          break;
        }
        e locale4 = localw2.d();
        if (i2 != 0) {
          break label519;
        }
        if ((this.fb.getBool(locale4)) && (locale4 != locale2))
        {
          int n = this.Z.getInt(locale4);
          if (i3 != 0) {
            continue;
          }
          if (n != j)
          {
            this.db[n] += 1.0D;
            d3 += 1.0D;
            if (i3 != 0) {
              continue;
            }
            if (this.db[n] == 1.0D) {
              this.gb += 1.0D;
            }
          }
        }
        localw2.f();
      } while (i2 == 0);
      this.db[j] = d3;
      if (i3 == 0) {
        if (d2 == 0.0D)
        {
          if (i3 != 0) {
            break label553;
          }
          if (d3 > 0.0D) {
            this.gb += 1.0D;
          }
        }
      }
      if (i3 == 0) {
        if (d2 > 0.0D)
        {
          if (i3 != 0) {
            break label584;
          }
          if (d3 == 0.0D) {
            this.gb -= 1.0D;
          }
        }
      }
      double d4 = this.gb - d1;
      if (i3 == 0)
      {
        if (d4 > 0.0D)
        {
          double d5 = 1.0D - Math.exp(-d4 / paramDouble);
          if (i3 != 0) {
            break label877;
          }
          if (this.ob.nextDouble() < d5)
          {
            this.gb = d1;
            this.fb.a(locale1, true);
            this.fb.a(locale2, false);
            paramArrayOfe[j] = locale1;
            this.db[j] = d2;
            w localw3 = locale1.o();
            e locale5;
            int i1;
            do
            {
              do
              {
                if (!localw3.e()) {
                  break label767;
                }
                locale5 = localw3.d();
                i1 = this.Z.getInt(locale5);
                if (i2 != 0) {
                  break;
                }
                if (i1 != j)
                {
                  if (i3 != 0) {
                    continue;
                  }
                  if (this.fb.getBool(locale5)) {
                    this.db[i1] += 1.0D;
                  }
                }
                localw3.f();
              } while (i2 == 0);
            } while (i3 != 0);
            localw3 = locale2.o();
            do
            {
              if (!localw3.e()) {
                break label865;
              }
              locale5 = localw3.d();
              i1 = this.Z.getInt(locale5);
              if (i2 != 0) {
                break;
              }
              if (i1 != j)
              {
                if (i3 != 0) {
                  continue;
                }
                if (this.fb.getBool(locale5)) {
                  this.db[i1] -= 1.0D;
                }
              }
              localw3.f();
            } while (i2 == 0);
          }
        }
        if (i3 != 0) {
          break label903;
        }
      }
      if (i3 == 0)
      {
        if (d1 > this.gb) {
          bool = true;
        }
        i++;
      }
      if (i2 == 0) {
        break;
      }
    }
    label519:
    label553:
    label584:
    label865:
    label877:
    return bool;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.e.d

 * JD-Core Version:    0.7.0.1

 */